<template>
    <div class="marsk" v-if="visible">
       <div class="modal-wrap">
            <div class="title">提示</div>
            <div class="body">提示内容</div>
            <div class="footer">
                <button @click="confirm">确定</button>
            </div>
       </div>
    </div>

</template>
<script>
    export default{
        props:{
            visible:{
                type:Boolean,
                default() {
                    return false
                }
            }
        },
        methods:{
            confirm() {
                this.$emit("on-confirm")
            }
        }
    }

</script>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    .marsk{
        position:absolute;
        width: 100%;
        height: 100%;
        background-color:rgba(34, 32, 32, 0.7);
        /* background-color: red; */
    }
    .marsk .modal-wrap{
        width: 300px;
        height: 200px;
        border-radius: 20px;
        background-color: white;
        margin: auto;
        position: relative;
        top: calc(50% - 100px);
        overflow: hidden;
    }
    .marsk .modal-wrap .title{
        margin: 20px 30px 10px 130px;
    }
    .marsk .modal-wrap .body{
        margin: 40px 30px 10px 114px;
    }
    .marsk .modal-wrap .footer button{
        margin: 20px 10px 10px 80px;
        width: 140px;
        height: 30px;
        border: none;
        background-color: blue;
        color: white;
        border-radius: 5px;
    }
</style>